Skip to main content

iqr

iqr(matrix1: any[] | Mat | Tensor) : number

param matrix1 an Array, Mat or Tensor (or a series of numbers) to find the inter-quartile range of

returns - number - representing the inter-quartile range value.

The inter-quartile range, or the midspread or middle 50%, is the difference between the 75th and 25th percentiles of the data. Hence, this function takes data from a construct, whether it is a series of numbers, an Array, Mat or Tensor and finds the 75% and 25% percentiles, namely 'q1' and 'q3', (the 1st and 3rd quantiles) for 0.25 and 0.75. Then we return 'q3-q1' to end up with the iqr or middle 50% of the data. (can be called 'q2').